import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { MainComponent } from './main.component';


const routes: Routes = [
  {
    path: '',
    component: MainComponent,
    children: [
      {
        path: '',
        redirectTo: 'form-control',
        pathMatch: 'full'
      },
      {
        path: 'form-control',
        loadChildren: () => import('./pages/form-control/form-control.module').then(m => m.FormControlModule)
      },
      {
        path: 'form-group',
        loadChildren: () => import('./pages/form-group/form-group.module').then(m => m.FormGroupModule)
      },
      {
        path: 'form-array',
        loadChildren: () => import('./pages/form-array/form-array.module').then(m => m.FormArrayModule)
      }
    ]
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class MainRoutingModule { }
